package cn.aiyuan.controller;

import cn.aiyuan.pojo.User;
import cn.aiyuan.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author wy
 * @since 2020/7/6
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/findAll")
    public String findByCondition(Model model){
        List<User> all = userService.findAll();
        model.addAttribute("users",all);
        return "user";
    }

}
